package com.thesis.object;

import java.util.ArrayList;

/**
 * ListServeTableDetail class
 * 
 * this class save all tables in active of current user and bill of this table
 * @author NgocTuyen
 *
 */
public class ListServeTableDetail {
	//instance variable
	private static ListServeTableDetail instance = new ListServeTableDetail();
	
	//arraylist save all table and bill
	ArrayList<ServeTableDetail> listServeTableDetail;
	
	/**
	 * Constructor function
	 * 
	 * Constructor
	 * 
	 * @access private 
	 * 
	 * @param null
	 * 
	 * @return null
	 * 
	 */
	private ListServeTableDetail(){
		listServeTableDetail = new ArrayList<ServeTableDetail>();
	}
	
	/**
	 * getInstance static function
	 * 
	 * @access public
	 * 
	 * @param null
	 * 
	 * @return ListServeTableDetail
	 *  + instance object
	 */
	public static ListServeTableDetail getInstance(){
		if (instance == null ){
			instance = new ListServeTableDetail();
		}
		return instance;
	}
	
	/**
	 * addServeTableDetail function
	 * 
	 * save bill and table in to list of all bills and tables of current user
	 * 
	 * @access public 
	 * 
	 * @param detail: detail about bill and table
	 * 
	 * @return void
	 */
	public void addServeTableDetail( ServeTableDetail detail){
		listServeTableDetail.add(detail);
	}
	
	public ArrayList<ServeTableDetail> getListServeTableDetail (){
		return listServeTableDetail;
	}
	public void clear(){
		instance = null;
		
	}
}
